package com.lmx.repoDomain.tmodel;

import io.katharsis.resource.annotations.JsonApiIncludeByDefault;
import io.katharsis.resource.annotations.JsonApiResource;
import io.katharsis.resource.annotations.JsonApiToOne;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

/**
 * 老人用餐统计(日)
 *
 * @author ytche
 * @date 2017年9月1日
 *
 */
@Entity
@Table(name = "tnb_food_paln_day_record_view")
@JsonApiResource(type = "foodPlanDayRecord")
public class FoodPlanDayRecord extends BaseEntity {
	private static final long serialVersionUID = 1L;
	private Food food;
	private CustomerFoodPlan plan;
	private Integer diningDate;
	private Dicttype diningTime;
	private Integer num;
	private Long bedId;
	private Long roomId;
	private Long floorId;
	private Long buildingId;

	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.JOIN)
	@JsonApiToOne
	@JsonApiIncludeByDefault
	@JoinColumn(name = "food_id")
	public Food getFood() {
		return food;
	}

	public void setFood(Food food) {
		this.food = food;
	}

	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.JOIN)
	@JsonApiToOne
	@JsonApiIncludeByDefault
	@JoinColumn(name = "plan_id")
	public CustomerFoodPlan getPlan() {
		return plan;
	}

	public void setPlan(CustomerFoodPlan plan) {
		this.plan = plan;
	}

	@Column(name = "dining_date")
	public Integer getDiningDate() {
		return diningDate;
	}

	public void setDiningDate(Integer diningDate) {
		this.diningDate = diningDate;
	}

	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.JOIN)
	@JsonApiToOne
	@JsonApiIncludeByDefault
	@JoinColumn(name = "dining_time_id")
	public Dicttype getDiningTime() {
		return diningTime;
	}

	public void setDiningTime(Dicttype diningTime) {
		this.diningTime = diningTime;
	}

	public Integer getNum() {
		return num;
	}

	public void setNum(Integer num) {
		this.num = num;
	}

	@Column(name = "bed_id")
	public Long getBedId() {
		return bedId;
	}

	public void setBedId(Long bedId) {
		this.bedId = bedId;
	}

	@Column(name = "room_id")
	public Long getRoomId() {
		return roomId;
	}

	public void setRoomId(Long roomId) {
		this.roomId = roomId;
	}

	@Column(name = "floor_id")
	public Long getFloorId() {
		return floorId;
	}

	public void setFloorId(Long floorId) {
		this.floorId = floorId;
	}

	@Column(name = "building_id")
	public Long getBuildingId() {
		return buildingId;
	}

	public void setBuildingId(Long buildingId) {
		this.buildingId = buildingId;
	}

}
